package com.java2007.dao;

import com.java2007.pojo.FoodType;

import java.sql.SQLException;
import java.util.List;

/**
 * 菜类别持久层接口
 */
public interface FoodTypeDao {

    /**
     * 查询所有菜类别
     * @return
     * @throws SQLException
     */
    List<FoodType> selectAll() throws SQLException;

    /**
     * 通过菜类别名查询
     * @param foodTypeName
     * @return
     */
    List<FoodType> findByFoodTypeName(String foodTypeName) throws SQLException;

    /**
     * 根据ID删除菜类别
     * @param typeId
     * @return
     * @throws SQLException
     */
    int deleteByFoodTypeId(Integer typeId) throws SQLException;

    /**
     * 根据菜类别名添加
     * @param typeName
     * @return
     * @throws SQLException
     */
    int saveByFoodTypeName(String typeName) throws SQLException;

    /**
     * 根据id查询
     * @param typeId
     * @return
     */
    FoodType findByFoodTypeId(int typeId)throws SQLException;


    /**
     * 根据id修改菜类别名
     * @param foodType
     * @return
     * @throws SQLException
     */
    int updata(FoodType foodType)throws SQLException;
}
